import 'package:boss/models/material.dart' as material;
import 'package:boss/ui/widget/custom_list_title.dart';
import 'package:hi_common/hi_common.dart';
import 'package:flutter/material.dart';

class MaterialItem extends StatelessWidget {
  final material.Material data;
  final VoidCallback onTap;

  const MaterialItem({
    Key key,
    @required this.data,
    this.onTap,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return CustomListTitle(
      title: data.meterialName,
      trailing: Expanded(
        child: Text(
          '${AmountUtil.price2String(data.meterialPrice)}元',
          textAlign: TextAlign.end,
        ),
      ),
      onTap: onTap,
    );
  }
}
